<template>
	<view ref="departmentmanger">
		<view v-if="staffList != ''">
		<view v-for="item,index in staffList" :key="index">
			<uni-list-item link style="padding-right: 15rpx;">
				<template v-slot:header>
					<view class="slot-row" style="padding-left: 20rpx;">
					{{ item.name }} 
					<span style="margin-left:10rpx;">{{ item.mobile }}</span>
					（<span v-if="$store.getters.companyInfo.adminId == item.id && $store.getters.companyInfo.legalPersonId == item.id">法定代表人,企业管理员,{{ item.roleName.replace("普通员工", "") }}</span>
					<span v-else-if="$store.getters.companyInfo.legalPersonId == item.id">
					法定代表人,{{ item.roleName.replace("普通员工", "") }}
					</span>
					<span v-else-if="$store.getters.companyInfo.adminId == item.id">
					  企业管理员,{{ item.roleName.replace("普通员工", "") }}
					</span>
					<span v-else>{{ item.roleName }}</span>）</view>
				</template>
				<template v-slot:footer>
					<view class="slot-row">
						<i class="iconfont guanliIcon" v-if="$store.getters.companyInfo.adminId == item.id">&#xe62c;</i>
						<span v-if="item.status == 1">账号正常</span>
						<span v-if="item.status == 0" style="color:red;">账号停用</span>
					</view>
				</template>
			</uni-list-item>
		</view>
		</view>
		<!-- 暂无数据 -->
		<view style="background-color: #f1f1f1;" v-else>
			<luanqingEmpty :show="true" text="没有更多数据啦" />
		</view>
	</view>
</template>

<script>
	import luanqingEmpty from '@/components/luanqing-empty/luanqing-empty';
	export default {
		name: "departmentPerson",
		components:{
			luanqingEmpty
		},
		props:{
			 staffList:{
				 type:Array,
			 }
		},
	}
</script>

<style scoped lang="scss">
	.slot-row{font-size: 26rpx;color: #666666;}
	.guanliIcon{
		margin-right: 5rpx;
		vertical-align: middle;
		margin-bottom: 2rpx;
		display: inline-block;
	}
	.certiyImg{
		width: 26rpx;
		height: 26rpx;
		margin-left: 3rpx;
		display: inline-block;
		vertical-align: middle;
		margin-bottom: 8rpx;
	}
</style>
